#ifndef prs_FrmLineStyle_H
#define prs_FrmLineStyle_H

#include "prs_FrmFunc.h"
#include "prs_FrmRules.h"
#include "prs_FrmStyleState.h"
#include "frm_control_TLine.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmLineStyle : public TNodeStyleControl
{
  DECLARE_ClientNode()
  TAttrNodeType<nodeType_Line> NodeType;
  TAttrObject<nodeType_Style,frm::control::TLine::TStyle> Style;
  //
  TNodeFrmLineStyle() : NodeType(this),Style(this) {}
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmLineStyle : public snt::TRule
{
  TRuleFrmLineStyle(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmStyleState &RStyleState
  );
  
private:  
  TNodeFrmLineStyle *GetNode() { return dynamic_cast<TNodeFrmLineStyle*>(vParentNode.Pointer());}
  //
  void FNormal  (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Normal );}
  void FSelected(snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Selected );}
  void FFocused (snt::TParams &Params) { rStyleState.SetState( &GetNode()->Style.Value.Focused );}
  //
  svl::TVariant &vParentNode;
  snt::TAlter A;
  TRuleFrmStyleState &rStyleState;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
